test: add result-level ANN plan validation above k threshold - #269
Merged
Conversation
Follow-up from #259 review: the existing SQL-text assertion only verifies the query contains CROSS JOIN, which would pass even if the planner silently reordered. This test seeds 200 real memories across two container tags (above the k=128 ANN threshold), runs a tagged search, and asserts that: - the closest target-tag memory ranks first (similarity > 0.9) - no other-container-tag memories leak into results - the result count respects the limit This catches future planner/driver regressions at the behavior level rather than SQL string matching.
Collaborator
Author
|
Reviewer quick guide: This is a test-only PR (no source changes). It adds one integration test that seeds 200 real memories across two container tags (above the k=128 ANN threshold) and verifies:
This addresses @NaNomicon's follow-up from #259 review: the existing SQL-text test only checks for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up from #259 review feedback by @NaNomicon: the existing SQL-text assertion in
turso-vector-search.test.tsonly verifies the query containsCROSS JOINand string ordering, which would pass even if the planner silently reordered and search degraded.This adds a behavior-level test:
k=128ANN threshold for tagged searches.Testing
bun test tests/turso-vector-search.test.ts— 3/3 pass (existing 2 + new 1)tsc --noEmitclean